package com.example.serverdemo.utils.log;

import cn.hutool.core.date.DateTime;
import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;

public class PrintLogUtil {
    private static final Log mLog = LogFactory.get("DeviceCommunicationController");
    public static void printInfo(Object obj, String msg){
        mLog.info(DateTime.now().toDateStr());
        mLog.info("LogInfo：" + DateTime.now().toDateStr());
        mLog.info("ClassName：" + obj.getClass().getTypeName());
        mLog.info("ClassNameHashCode：" + obj.getClass().hashCode());
        mLog.info("Msg：" + msg);
        System.out.println();
    }
    public static void printError(Object obj,Exception e){
        mLog.error(e);
//        mLog.info(DateTime.now().toDateStr());
//        mLog.info("LogError：" + DateTime.now().toDateStr());
//        mLog.info("ClassName：" + obj.getClass().getTypeName());
//        mLog.info("ClassNameHashCode：" + obj.getClass().hashCode());
//        mLog.info("ExceptionMessage：" + e.getMessage());
//        mLog.info("ExceptionStackTrace：" + e.getStackTrace());
//        mLog.info("ExceptionCause：" + e.getStackTrace());
        System.out.println();
    }
    public static void printError(String className,Exception e){
        mLog.error(e);
//        mLog.info(DateTime.now().toDateStr());
//        mLog.info("LogError：" + DateTime.now().toDateStr());
//        mLog.info("ClassName：" + className);
//        mLog.info("ExceptionMessage：" + e.getMessage());
//        mLog.info("ExceptionStackTrace：" + e.getStackTrace());
        System.out.println();
    }
}
